home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / trubasic / rolldemos / chooser / intmenu.tru < prev    next >
Text File  |  1994-08-02  |  2KB  |  70 lines

  1. external
  2. ! main menu loop for interactiv demos
  3. module int
  4. DECLARE PUBLIC intpts(,),inttxt$()
  5. sub int_demos
  6.  
  7.     call draw_int
  8.     call waitup
  9.     do
  10.         call getclick_int(op)
  11.     if op=1 then
  12.         chain "!cd ../demos/interact;../../basic/tru -i tbmap.tru &",return
  13.     elseif op=2 then
  14.         chain "!cd ../demos/interact;../../basic/tru -i tbedit.tru &",return
  15.     elseif op=3 then
  16.         chain "!cd ../demos/interact;../../basic/tru -i record.tru &",return
  17.     elseif op=4 then
  18.         chain "!cd ../demos/interact;../../basic/tru -i house3.tru &",return
  19.     elseif op=5 then 
  20.         chain "!cd ../demos/interact;../../basic/tru -i aboutact.tru &",return
  21.     elseif op=6 then
  22.         chain "!cd ../demos/interact;../../basic/tru -i zplot3.tru &",return
  23.     elseif op=0 then
  24.         exit sub
  25.     end if
  26.     if op<>0 and op<>-1 then
  27.                 call expand(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4))
  28.    draw textbox(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4),inttxt$(op))
  29.                 call waitup
  30.         pause 3
  31.               call unexpand(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4))
  32.    draw textbox(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4),inttxt$(op))
  33.     end if
  34.  
  35.     if refresh(1)=1 then 
  36.         call draw_int
  37.     end if
  38.     loop
  39. end sub
  40.  
  41. sub draw_int
  42.         let u=ubound(intpts,1)
  43.         clear
  44.         for i=1 to u
  45.                 draw intbox(i)
  46.         next i
  47.         box keep 0,1,0,1 in intbox$
  48. end sub
  49.  
  50. picture intbox(op)
  51.     draw box(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4),op)
  52.    draw textbox(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4),inttxt$(op))
  53. end picture
  54.  
  55. sub getclick_int(op)
  56.         get mouse x,y,state
  57.         let op=-1
  58.         if state<>0 and x>=0 and x<=1 and y>=0 and y<=1 then
  59.            let u=ubound(intpts,1)
  60.        let op=0
  61.            for i=1 to u
  62.                 if x>intpts(i,1) and x<intpts(i,2) and y>intpts(i,3) and y<intpts(i,4) then
  63.                         let op=i
  64.                         exit sub
  65.                 end if
  66.            next i
  67.         end if
  68. end sub
  69. end module
  70.